package com.cskaoyan.market.service.wx.impl;

import com.cskaoyan.market.db.domain.MarketBrand;
import com.cskaoyan.market.db.domain.MarketBrandExample;
import com.cskaoyan.market.db.mapper.MarketBrandMapper;
import com.cskaoyan.market.service.wx.WxBrandService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author：Katherine
 * @Package：com.cskaoyan.market.service.wx.teamwork.impl
 * @Project：market
 * @name：AdminBrandServiceImpl
 * @Date：2023/5/23 11:20
 * @Filename：AdminBrandServiceImpl
 */
@Service
public class WxBrandServiceImpl implements WxBrandService {

    @Autowired
    MarketBrandMapper marketBrandMapper;

    @Override
    public List<MarketBrand> list(Integer page, Integer limit) {
        MarketBrandExample brandExample = new MarketBrandExample();
        brandExample.or().andDeletedEqualTo(false);
        PageHelper.startPage(page,limit);
        List<MarketBrand> marketBrands = marketBrandMapper.selectByExample(brandExample);

        return marketBrands;
    }

    @Override
    public MarketBrand detail(Integer id) {
        MarketBrand marketBrand = marketBrandMapper.selectByPrimaryKey(id);
        return marketBrand;

    }
}
